departments = function() {
	return Department.find({});
};

currUserEmail = function() {
	var email = Meteor.user().profile.email;
	return email ? email : Meteor.user().emails[0].address;
};

currUserProfile = function() {
	return Meteor.user() ? Meteor.user().profile : {};
};

isEqual = function(arg1, arg2) {
	return arg1 == arg2;
};

flush = function(){
	return Session.get("currStatus");
};

isAdmin = function(){
	if (Meteor.userId()) {
		if (Meteor.user().profile && Meteor.user().profile.isAdmin) {
			return Meteor.user().profile.isAdmin;
		};
	};
}

UI.registerHelper('departments', departments);
UI.registerHelper('currUserEmail', currUserEmail);
UI.registerHelper('currUserProfile', currUserProfile);
UI.registerHelper('isEqual', isEqual);
UI.registerHelper('flush', flush);
UI.registerHelper('isAdmin', isAdmin);